﻿@{
    ViewData["Title"] = "Index";
    Layout = "~/Areas/Console/Views/Shared/_Layout.cshtml";
}
@section head{
    <style>
        .layui-table-cell {
            height: auto;
            line-height: initial;
        }

        .layui-table thead tr:first-child {
            height: 50px !important;
        }

        .layui-form-checkbox[lay-skin=primary] {
            min-height: 17px !important;
        }

        .layui-form-label {
            width: 90px !important;
        }

        .layui-input-block {
            margin-left: 90px !important;
        }

        .layui-btn {
            margin-left: 0px !important;
        }
    </style>
    <script src="~/js/CommonHelper.js"></script>
    <script type="text/javascript">
        var table;
        layui.config({
            base: '../../layuiadmin/' //静态资源所在路径
        }).extend({
            index: 'lib/index' //主入口模块
        }).use(['index', 'table', 'form'], function () {
            var $ = layui.$
                , form = layui.form
                , admin = layui.admin
                , table = layui.table;
 
            table.render({
                elem: '#table-datalist'
                , url: '/Console/SystemConfig/rateGetListJson'
                , limit: 10
                , title: '数据表'
                , where: {}
                , cols: [[
                    { type: 'checkbox', fixed: 'left' }
                    , { field: 'id', title: '编号', width: 80, sort: true }
                    , { field: 'rate', width: 100, title: '汇率' }
                    , {
                        field: 'addtime', minWidth: 250, title: '添加时间', templet: function (res) {
                            return res.addtime
                        }
                    }
                ]]
                , page: { layout: ['prev', 'page', 'next', 'refresh'] }
                , parseData: function (res) {
                    //console.log(res);
                }
            });
            /* 监听提交 */
            form.on('submit(search)', function (data) {
                var params = {};
                params["name"] = $("#_name").val();

                table.reload('table-datalist', {
                    where: params,
                    page: { curr: 1, layout: ['prev', 'page', 'next', 'refresh'] }
                });
                return false;
            });

        });
    </script>
}
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card" style="display:none;">
                @*<div class="layui-card-header">条件查询</div>*@
                <div class="layui-card-body">
                    <form class="layui-form layui-form-pane" action="" lay-filter="component-form-group">
                        <div class="layui-form-item">
                        </div>
                    </form>
                </div>
            </div>
            <div class="layui-card">
                <div class="layui-card-body">
                    <table class="layui-hide" id="table-datalist" lay-filter="table-datalist"></table>
                </div>
            </div>
        </div>
    </div>
</div>